import 'package:flutter/material.dart';

import '../home/home.dart';

class PassWord extends StatefulWidget {
  const PassWord({Key? key}) : super(key: key);

  @override
  State<PassWord> createState() => _PassWordState();
}

class _PassWordState extends State<PassWord> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('密码输入',style: TextStyle(fontSize: 12),),
        leading: IconButton(onPressed: () {
          //页面返回
          Navigator.pop(context);
        },
          icon: Icon(Icons.keyboard_arrow_left_rounded),

        ),
      ),
      body: Container(
        child: Column(
          children:  [
            //密码框
            Container(
              height: 70,
              margin: EdgeInsets.only(
                  right: 30,
                  left: 30,
                  top: 20
              ),
              child: TextField(
                keyboardType: TextInputType.text,
                // controller: _phone,
                maxLength: 11,
                decoration: InputDecoration(
                    hintText: '输入密码',
                    fillColor: Colors.black12,
                    filled: true,
                    enabledBorder: OutlineInputBorder(
                      borderSide: BorderSide(color: Colors.white),
                      borderRadius: BorderRadius.all(Radius.circular(10)),

                    ),
                    focusedBorder: OutlineInputBorder(
                      borderSide: BorderSide(color: Colors.white),
                      borderRadius: BorderRadius.all(Radius.circular(10)),
                    )

                ),
                obscureText: true,

              ),
            ),

            Container(
              margin: EdgeInsets.only(
                  top: 10
              ),
              width: 400,
              height: 45,

              child: Container(
                margin: EdgeInsets.only(
                  right: 30,left: 30,
                ),
                child: Container(
                  width: 280,
                  height: 50,
                  child: FlatButton(
                    minWidth: MediaQuery.of(context).size.width-40,
                    highlightColor: Colors.cyan[700],
                    color: Colors.lightBlue,
                    shape: RoundedRectangleBorder(
                        borderRadius: BorderRadius.circular(8)
                    ),
                    onPressed: (){
                      //页面提交
                      Navigator.push(context, MaterialPageRoute(builder: (context) => Home()));

                    }, child: Text('登陆',style: TextStyle(color: Colors.white),),),
                ),
              ),)



          ],
        ),
      ),

    );
  }
}
